Skip to content

Conversation

@ByteOtter
Copy link
Contributor

What this PR does / why we need it:

This PR addresses some issues with potentially invalid function calls in the git module.
The issue arose from a post-fact check if the given git_directory parameter was an instance of PathLike , raising an error if not and then going ahead and calling pathlib specific function like exists() on the parameter. git_directory remained typed as str | PathLike though.

This led to calls to pathlib.Path-specific methods such as .exists(), .is_dir(), and .match() on values that Pyright could not guarantee were Path instances.

This PR changes that behavior to always explicitly cast git_directory into a Path object; eliminating the need for the type checks.

Which issue(s) this PR fixes:
Tracks #152

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (b0f7ceb) to head (d007ff0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
- Coverage   93.23%   93.22%   -0.02%     
==========================================
  Files          30       30              
  Lines        1375     1372       -3     
==========================================
- Hits         1282     1279       -3     
  Misses         93       93              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

* always explicitly cast path strings into Path object so function calls
are always valid
Copy link
Contributor

@NotTheEvilOne NotTheEvilOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ByteOtter ByteOtter merged commit ef7d368 into main Sep 25, 2025
9 of 11 checks passed
@ByteOtter ByteOtter deleted the lint/fix-git-module branch September 25, 2025 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants